package com.wmh.baseservice.robot.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.wmh.baseservice.common.mybatisplus.handler.JsonLongSetTypeHandler;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Set;

/**
 * 
 * @author 谢骏
 * @TableName robot_job_task
 * @createDate 2023-08-31 14:51:17
 */
@Data
@Accessors(chain = true)
@TableName(value = "robot_job_task", autoResultMap = true)
public class RobotJobTask implements Serializable {

    /**
     * 主键
     */
    @TableId(value = COL_ID ,type = IdType.AUTO)
    private Long id;

    /**
     * 任务名称
     */
    @TableField(value = COL_NAME)
    private String name;

    /**
     * 任务状态 0 : 初始化中 1 : 开启 2 :暂停
     */
    @TableField(value = COL_STATUS)
    private Integer status;


    /**
     * 发布任务单元
     * */
    @TableField(value = COL_PUSH_TASK_IDS,typeHandler = JsonLongSetTypeHandler.class)
    private Set<Long> pushTaskIds;

    /**
     * cron 表达式
     */
    @TableField(value = COL_CRON)
    private String cron;

    /**
     * 管理员编号
     */
    @TableField(value = COL_AD_ID)
    private Long adId;

    /**
     * 创建时间
     */
    @TableField(value = COL_CREATE_TIME)
    private LocalDateTime createTime;

    /**
     * 修改时间
     */
    @TableField(value = COL_UPDATE_TIME)
    private LocalDateTime updateTime;

    /**
     * 是否删除 0未删除 1删除
     */
    @TableField(value = COL_DELETED)
    @TableLogic
    private Integer deleted;


    /**
     * 主键
     */
    public static final String COL_ID = "id";

    /**
     * 任务名称
     */
    public static final String COL_NAME = "name";

    /**
     * 任务状态 0 : 初始化中 1 : 开启 2 :暂停
     */
    public static final String COL_STATUS = "status";


    /**
     * 发布任务单元
     * */
    public static final String COL_PUSH_TASK_IDS = "push_task_ids";

    /**
     * cron 表达式
     */
    public static final String COL_CRON = "cron";

    /**
     * 管理员便阿红
     */
    public static final String COL_AD_ID = "ad_id";

    /**
     * 创建时间
     */
    public static final String COL_CREATE_TIME = "create_time";

    /**
     * 修改时间
     */
    public static final String COL_UPDATE_TIME = "update_time";

    /**
     * 是否删除 0未删除 1删除
     */
    public static final String COL_DELETED = "deleted";

    @TableField(exist = false)
    static final long serialVersionUID = 1L;
}
